{{include file="public/header" /}}

<!-- right content start  -->
<div class="content-right">
    <!-- second nav start -->
    {{include file="site/public/nav" /}}
    <!-- second nav end -->

    <div class="content">
        <!-- nav start -->
        {{include file="site/public/siteset_nav" /}}
        <!-- nav end -->

        <!-- form start -->
        <form class="am-form form-validation" action="{{:MyUrl('admin/site/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/site/index', ['nav_type'=>$nav_type, 'view_type'=>$view_type])}}" enctype="multipart/form-data">
            <!-- 基础 -->
            <div class="am-panel am-panel-default am-margin-top-sm">
                <div class="am-panel-hd">
                    <h3 class="am-panel-title">基础</h3>
                </div>
                <div class="am-panel-bd am-padding-vertical-xs">
                    <!-- 是否预约模式 -->
                    <div class="am-form-group">
                        <label>{{$data.common_order_is_booking.name}}<span class="am-form-group-label-tips">{{$data.common_order_is_booking.describe}}</span></label>
                        <select name="{{$data.common_order_is_booking.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.common_order_is_booking.error_tips}}" required>
                            {{foreach $common_is_text_list as $v}}
                                <option value="{{$v.id}}" {{if isset($data['common_order_is_booking']['value']) and $data['common_order_is_booking']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
                            {{/foreach}}
                        </select>
                    </div>

                    <!-- 库存 -->
                    <div class="am-form-group">
                        <label>{{$data.common_is_deduction_inventory.name}}<span class="am-form-group-label-tips">{{$data.common_is_deduction_inventory.describe}}</span></label>
                        <select name="{{$data.common_is_deduction_inventory.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.common_is_deduction_inventory.error_tips}}" required>
                            {{foreach $common_is_text_list as $v}}
                                <option value="{{$v.id}}" {{if isset($data['common_is_deduction_inventory']['value']) and $data['common_is_deduction_inventory']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
                            {{/foreach}}
                        </select>
                    </div>
                    <div class="am-form-group">
                        <label>{{$data.common_deduction_inventory_rules.name}}<span class="am-form-group-label-tips">{{$data.common_deduction_inventory_rules.describe}}</span></label>
                        <select name="{{$data.common_deduction_inventory_rules.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.common_deduction_inventory_rules.error_tips}}" required>
                            {{foreach $common_deduction_inventory_rules_list as $v}}
                                <option value="{{$v.id}}" {{if isset($data['common_deduction_inventory_rules']['value']) and $data['common_deduction_inventory_rules']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
                            {{/foreach}}
                        </select>
                    </div>

                    <!-- 订单商品销量 -->
                    <div class="am-form-group">
                        <label>{{$data.common_goods_sales_count_inc_rules.name}}<span class="am-form-group-label-tips">{{$data.common_goods_sales_count_inc_rules.describe}}</span></label>
                        <select name="{{$data.common_goods_sales_count_inc_rules.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.common_goods_sales_count_inc_rules.error_tips}}" required>
                            {{foreach $common_sales_count_inc_rules_list as $v}}
                                <option value="{{$v.id}}" {{if isset($data['common_goods_sales_count_inc_rules']['value']) and $data['common_goods_sales_count_inc_rules']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
                            {{/foreach}}
                        </select>
                    </div>

                    <!-- 订单支付 -->
                    <div class="am-form-group">
                        <label>{{$data.home_is_enable_order_bulk_pay.name}}<span class="am-form-group-label-tips">{{$data.home_is_enable_order_bulk_pay.describe}}</span></label>
                        <select name="{{$data.home_is_enable_order_bulk_pay.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.home_is_enable_order_bulk_pay.error_tips}}" required>
                            {{foreach $common_is_text_list as $v}}
                                <option value="{{$v.id}}" {{if isset($data['home_is_enable_order_bulk_pay']['value']) and $data['home_is_enable_order_bulk_pay']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
                            {{/foreach}}
                        </select>
                    </div>
                    <div class="am-form-group">
                        <label>{{$data.common_is_pay_price_must_max_equal.name}}<span class="am-form-group-label-tips">{{$data.common_is_pay_price_must_max_equal.describe}}</span></label>
                        <select name="{{$data.common_is_pay_price_must_max_equal.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.common_is_pay_price_must_max_equal.error_tips}}" required>
                            {{foreach $common_close_open_list as $v}}
                                <option value="{{$v.value}}" {{if isset($data['common_is_pay_price_must_max_equal']['value']) and $data['common_is_pay_price_must_max_equal']['value'] eq $v['value']}}selected{{/if}}>{{$v.name}}</option>
                            {{/foreach}}
                        </select>
                    </div>

                    <!-- 线下支付 -->
                    <div class="am-form-group">
                        <label>{{$data.common_is_under_line_order_normal.name}}<span class="am-form-group-label-tips">{{$data.common_is_under_line_order_normal.describe}}</span></label>
                        <select name="{{$data.common_is_under_line_order_normal.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.common_is_under_line_order_normal.error_tips}}" required>
                            {{foreach $common_is_text_list as $v}}
                                <option value="{{$v.id}}" {{if isset($data['common_is_under_line_order_normal']['value']) and $data['common_is_under_line_order_normal']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
                            {{/foreach}}
                        </select>
                    </div>

                    <!-- 虚拟订单直接提交支付 -->
                    <div class="am-form-group">
                        <label>{{$data.common_fictitious_order_direct_pay.name}}<span class="am-form-group-label-tips">{{$data.common_fictitious_order_direct_pay.describe}}</span></label>
                        <select name="{{$data.common_fictitious_order_direct_pay.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.common_fictitious_order_direct_pay.error_tips}}" required>
                            {{foreach $common_is_text_list as $v}}
                                <option value="{{$v.id}}" {{if isset($data['common_fictitious_order_direct_pay']['value']) and $data['common_fictitious_order_direct_pay']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
                            {{/foreach}}
                        </select>
                    </div>
                </div>
            </div>

            <!-- 默认支付方式 -->
            <div class="am-panel am-panel-default am-margin-top-sm">
                <div class="am-panel-hd">
                    <h3 class="am-panel-title">默认支付方式</h3>
                </div>
                <div class="am-panel-bd">
                    <div class="business-form-group am-padding-vertical-0 platform-list-value-container">
                        <p class="am-text-warning">可以设置不同平台对应的默认支付方式、请先在[ 网站管理 -> 支付方式 ]中安装好支付插件启用并对用户开放</p>
                        {{foreach $common_platform_type as $v}}
                            <div class="am-input-group am-input-group-sm">
                                <span class="am-input-group-btn">
                                    <button type="button" class="am-btn am-btn-default am-radius">{{$v.name}}</button>
                                </span>
                                <select name="common_default_payment[{{$v.value}}]" class="am-radius chosen-select" data-placeholder="可选择..." data-validation-message="请选择{{$v.name}}默认支付方式">
                                    <option value="">可选择...</option>
                                    {{if !empty($payment_list)}}
                                        {{foreach $payment_list as $pay}}
                                            {{if !empty($pay['apply_terminal']) and is_array($pay['apply_terminal']) and in_array($v['value'], $pay['apply_terminal'])}}
                                                <option value="{{$pay.payment}}" {{if !empty($data['common_default_payment']) and !empty($data['common_default_payment']['value']) and !empty($data['common_default_payment']['value'][$v['value']]) and $data['common_default_payment']['value'][$v['value']] eq $pay['payment']}}selected{{/if}}>{{$pay.name}}</option>
                                            {{/if}}
                                        {{/foreach}}
                                    {{/if}}
                                </select>
                            </div>
                        {{/foreach}}
                    </div>
                </div>
            </div>

            <div class="am-form-group am-form-group-refreshing am-margin-top-lg am-padding-left-0">
                <input type="hidden" name="nav_type" value="{{$nav_type}}" />
                <input type="hidden" name="view_type" value="{{$view_type}}" />
                <button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">保存</button>
            </div>
        </form>
        <!-- form end -->
    </div>
</div>
<!-- right content end  -->
        
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->